package com.作业.Day18;

public class Homework2 {
    static int j=0;
    public static void main(String[] args) {
        Thread threadA = new Thread(() -> {

            for (int i = 1; i <= 50; i++) {
                System.out.println(Thread.currentThread().getName() + i + "号病人在看病");
                Thread.currentThread().setPriority(5);
                if(i==10){
                  if(j==10){
                      continue;
                  }
                  else {
                      try {
                          Thread.sleep(100);
                      } catch (InterruptedException e) {
                          throw new RuntimeException(e);
                      }
                  }
                }
            }
        },"普通病号");
        Thread threadB = new Thread(() -> {

            for (; j <= 50; j++) {
                System.out.println(Thread.currentThread().getName() + j + "号病人在看病");
                Thread.currentThread().setPriority(10);
            }
        },"特需病号");
        threadA.start();
        threadB.start();

    }
}
